<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');
jimport('joomla.html.pagination');

class AuctionViewList extends JView
{
	function display($tpl = null)
	{
		global $option, $mainframe;
		$user = JFactory::getUser();
		$model = &$this->getModel();
		$gid = $model->checkAuction();

		if($user->get('guest') == 0 && $gid == 24){
			$tpl = "admin";
		} else if($user->get('guest') == 0 && $gid == 23){
			$tpl = "projector";
		} else if($user->get('guest') == 0 && $gid == 19){
			$tpl = "guest";
		} 

		$auc_id = JRequest::getVar('auc_id', 0);
		$auction = $model->getAuction($auc_id);
		
		if($auction->id == 0){
			$tpl = "noauction";
		}
		$this->assignRef('auction', $auction);		

		parent::display($tpl);
	}
}
?>